package com.cloudbroker.openapi.mobile.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMap;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.constants.YunxinUrl;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.chat.ChatT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;
import com.cloudbroker.openapi.mobile.util.YunxinUtil;

/**
 * Created by wangxu13798 on 2016/3/11.
 */
@Controller
public class YunxinController {

    @Resource
    private ChatT2BizService chatT2;

    /**
     * 云信注册
     * */
    @ResponseBody
    @RequestMapping("/account_create")
    @SaveLog(remark = "注册账号")
    public Map<String,Object> getAccessTokenByCode(HttpServletRequest request , String jsonpcallback){
        String str = YunxinUtil.doPost(YunxinUrl.CREATE_ACCOUNT, getSingleParameterMap(request));
        return VOUtil.setJsonpResult(JSONObject.parseObject(str), jsonpcallback);
    }

}
